package com.xwnet.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xwnet.basic.domain.BasicDomain;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
public class Department extends BasicDomain {
    private String name;
    private String intro;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//set
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")//get
    private Date create_time;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")//set
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")//get
    private Date update_time;
    //部门经理
    private Employee manager;
    //上级部门
    private Department parent;
    //部门路径
    private String path;
    //状态
    private Integer state;
    //部门树，子部门
    private List<Department> children = new ArrayList<>();
    @Override
    public String toString() {
        return "Department{" +
                "id=" + this.getId() +
                ", name='" + name + '\'' +
                ", intro='" + intro + '\'' +
                ", create_time=" + create_time +
                ", update_time=" + update_time +
                '}';
    }
}
